﻿@{
    ViewBag.Title = "电梯列表";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script type="text/javascript">
    function DeleteLift(id) {
        if (confirm("您确定要删除吗？")) {
            $.ajax({
                url: "/ParkingAreas/DelLift/" + id,
                cache: false,
                success: function (res) {
                    if (res) {
                        $("#tr" + id).remove();
                        alert("删除成功。");
                    } else {
                        alert("删除失败。");
                    }
                }
            });
        }
    }
</script>

@using AFT.Parking.Entity;
@using AFT.Parking.Foundation;
@using AFT.Parking.WebSite.Common
@using Newtonsoft.Json;

@model IPagedList<ParkingLift>
<div class="content-box">
    <!-- Start Content Box -->
    <div class="content-box-header">
        <h3>信息反馈列表</h3>

        <div class="clear"></div>
    </div>
    <form id="frm">
        <!-- End .content-box-header -->
        <div class="content-box-content">
            <div class="tab-content default-tab" id="tab1">
                <!-- This is the target div. id must match the href of this div's tab -->
                <div class="notification attention png_bg">
                    @{
                        int parkingId = Convert.ToInt32(ViewBag.ParkingId);
                    }
                    @if (parkingId > 0)
                    {
                        <a href="/parkingAreas/addLift/@ViewBag.ParkingId">新增电梯</a>
                    }
                </div>
                <table>
                    <thead>
                        <tr>
                            <th>名称</th>
                            <th>关联电梯</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tfoot>
                        <tr>
                            <td colspan="6">
                                <div class="pagination">
                                    @Html.Pager(Model)
                                </div>
                                <!-- End .pagination -->
                                <div class="clear"></div>
                            </td>
                        </tr>
                    </tfoot>
                    <tbody id="tBodyRows">
                        @foreach (var item in Model.Rows)
                        {
                            <tr id="@("tr"+item.Id)">
                                <td>
                                    @item.Name
                                </td>
                                <td>
                                    @item.CrossTo
                                </td>
                                <td>
                                    <a href="javascript:void(0);" title="Edit" onclick="DeleteLift(@item.Id)">删除</a>
                                </td>
                            </tr>
                        }
                    </tbody>
                </table>
            </div>
            <!-- End #tab1 -->
        </div>
        <!-- End .content-box-content -->
    </form>
</div>
